program number2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
mass: array of integer;
mass1: array of integer;
 h: textfile;
  F, i, j,l,    n,  xo,  yo : integer;
 a, b, x,  c, d,   a1,  b1:real;
begin
readln(xo,yo);
assignfile(h,'input.txt');
setlength(mass,n-1);
setlength(mass1,n-1);
rewrite(h);
read(h,n);
For i:=0 to n-2 do
 begin
 read(mass[i]);
 if(mass[i]>mass[i+1]) then
  begin
   l:=mass[i+1];
   mass[i]:=mass[i+1];
   mass[i+1]:=l;
  end;

 end;
For j:=0 to n-2 do
 begin
 read(mass1[j]);
 if(mass1[j]>mass1[j+1]) then
 begin
 l:=mass1[j];
 mass1[j]:=mass1[j+1];
 mass1[j]:=l;
 end;

 end;
   x:=(mass[n-1]-Yo);
a:=(F+x*(sqrt(f*f+x*x))/(f*f+x*x));
a1:=(F-x*(sqrt(f*f+x*x)))/(f*f+x*x);
  f:=(mass1[n-1]-yo);
b:=(x-F*(sqrt(f*f+x*x)))/(f*f+x*x);
b1:=(x+F*(sqrt(f*f+x*x)))/(f*f+x*x);
c:=-(b*yo)-(a*xo);
d:=(a*xo+b*yo+c)/(sqrt(a*a+b*b));
if(d<0) then
write('NO!');
CloseFile(h);
readln;

end.
